package com.jingzhi.count.controller;

import com.jingzhi.count.entity.MyResponse;
import com.jingzhi.count.entity.Sensor;
import com.jingzhi.count.mapper.SensorMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 作者： 张恒同
 * 时间： 2018/3/29   14:07
 * 描述： 传感器
 */
@RestController
public class SensorController extends BaseController{

    @Autowired
    private SensorMapper    mapper;

    @PostMapping(value = "/addSensor.do")
    public ResponseEntity<MyResponse> addSensor(@RequestParam(value = "pro_id", required = true) String pro_id,
                                                @RequestParam(value = "sensor_id", required = true) String sensor_id){
        MyResponse  response = new MyResponse();

        List<Sensor> sensors = mapper.selectAll();
        for (Sensor sensor : sensors){

        }

        return new ResponseEntity<MyResponse>(response, HttpStatus.OK);
    }


}
